﻿
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sproc_Flow_GetMaxStep_V2]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [dbo].[sproc_Flow_GetMaxStep_V2];
GO
CREATE PROCEDURE [dbo].[sproc_Flow_GetMaxStep_V2]
    @FlowID int
AS
BEGIN
SET NOCOUNT ON;

DECLARE @maxStepId INT;

SELECT @maxStepId = ISNULL(MAX(step_id), 0) FROM dbo.UDS_Flow_Step WHERE Flow_id = @FlowID;
RETURN @maxStepId;

END
GO